import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("alumni_event", { schema: "alumni" })
export class AlumniEvent {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "school_id",
    comment: "所属学校",
    unsigned: true,
    default: () => "'0'",
  })
  schoolId: number;

  @Column("varchar", { name: "name", length: 200, default: () => "'名称'" })
  name: string;

  @Column("varchar", { name: "address", length: 100, default: () => "'地点'" })
  address: string;

  @Column("varchar", { name: "cover", comment: "封面", length: 100 })
  cover: string;

  @Column("int", {
    name: "start_date",
    comment: "开启日期",
    unsigned: true,
    default: () => "'0'",
  })
  startDate: number;

  @Column("int", {
    name: "end_date",
    comment: "介绍日期",
    unsigned: true,
    default: () => "'0'",
  })
  endDate: number;

  @Column("int", {
    name: "registration_start_date",
    comment: "报名开始时间",
    unsigned: true,
    default: () => "'0'",
  })
  registrationStartDate: number;

  @Column("int", {
    name: "registration_end_date",
    comment: "报名结束",
    unsigned: true,
    default: () => "'0'",
  })
  registrationEndDate: number;

  @Column("varchar", { name: "excerpt", comment: "摘录", length: 200 })
  excerpt: string;

  @Column("text", { name: "content", nullable: true })
  content: string | null;

  @Column("text", { name: "history", nullable: true })
  history: string | null;

  @Column("tinyint", { name: "status", default: () => "'0'" })
  status: number;

  @Column("int", {
    name: "sort",
    comment: "排序越大越靠前",
    default: () => "'0'",
  })
  sort: number;

  @Column("int", {
    name: "creator_id",
    comment: "创建人",
    unsigned: true,
    default: () => "'0'",
  })
  creatorId: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;
}
